import 'package:boss/ui/widget/form/base_text_form_field.dart';
import 'package:boss/ui/widget/image/base_image.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class TasteLabel extends StatelessWidget {
  final VoidCallback onRemove;
  final ValueChanged<String> onChanged;
  final String initValue;

  const TasteLabel({
    Key key,
    this.onRemove,
    this.onChanged,
    this.initValue,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: <Widget>[
        Expanded(
          child: BaseTextFormField(
            maxLength: 10,
            prefixText: '口味名称',
            hintText: '请输入',
            onChanged: onChanged,
            initialValue: initValue,
          ),
        ),
        GestureDetector(
          onTap: onRemove,
          child: BaseImage(
            'assets/image/close_icon.png',
            width: 30.w,
            height: 30.w,
          ),
        ),
      ],
    );
  }
}
